package Text1;

import java.util.ArrayList;

/*
 *@Student 张策
 */
public class Main {
    public static void main(String[] args) {
        ArrayList<Dog> arrayList = new ArrayList<>();
        arrayList.add(new Dog("一号",1));
        arrayList.add(new Dog("二号"  ,2));
        arrayList.add(new Dog("三号",3));
//        arrayList.add(new Cat("小猫",3));
        for (Dog object :arrayList) {
//            Dog dog = (Dog) object;
            System.out.println(object.getName()+"-"+ object.getAge());
        }
    }
}
